package com.qd.common.panda.domain.entity.shop.product;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


/**
 * 商品介绍
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ProductDetailDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "商品编号不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "商品编号长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String productCode;
    /**
     * 商品详情介绍
     */
    @NotBlank(message = "商品详情介绍不能为空", groups = DefaultGroup.class)
    private String detail;

    @Override
    public void freeData() {
        this.productCode = null;
        this.detail = null;
        super.freeData();
    }
}
